//package com.example.recordingpen_datacollection;
//
//import okhttp3.*;
//
//import java.io.IOException;
//
//public class OkHttpRequestExample {
//    public static void main(String[] args) {
//        OkHttpClient client = new OkHttpClient();
//
//        String url = "http://localhost:10487/AI/AItxt";
//
//        String jsonBody = "{ \"content\": \"你是谁\", \"deviceId\": 0}";
//
//        RequestBody body = RequestBody.create(jsonBody, MediaType.parse("application/json"));
//
//        Request request = new Request.Builder()
//                .url(url)
//                .post(body)
//                .build();
//
//        try (Response response = client.newCall(request).execute()) {
//            if (response.isSuccessful()) {
//                String responseData = response.body().string();
//                System.out.println(responseData);
//            } else {
//                System.out.println("Request failed: " + response.message());
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//    }
//}
////{
//// "id":"as-b6ny5nquby",
//// "object":"chat.completion",
//// "created":1709012604,
//// "result":"1+1等于**2**。",
//// "is_truncated":false,
//// "need_clear_history":false,
//// "usage":{"prompt_tokens":5,
//    // "completion_tokens":8,
//    // "total_tokens":13
//    // }
//// }